#include "image.h"

Image::Image( Widget *_parent,
              Engine *_engine,
              int _x,
              int _y,
              int _w,
              int _h,
              QImage *img)
                  :Widget( _parent, _engine, _x, _y, _w, _h )
{
    this->img = img;
}

Image::~Image( void )
{
    ;
}

void Image::Paint( QPainter &painter )
{
    if( img )
    {
        painter.drawImage( x, y, *img, 0, 0, img->width(), img->height() );
    }
    else
    {
        painter.setPen( Qt::black );
        painter.drawLine( x, y, x + w, y + h );
        painter.drawLine( w, 0, 0, h );
    }
}


